home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / nn.zip / NEWS.H < prev    next >
C/C++ Source or Header  |  1989-12-31  |  2KB  |  83 lines

  1.  
  2.  
  3. struct news_header {
  4.  
  5.     int    ng_flag;    /* flags:            */
  6. #      define N_DIGEST 1    /*   article is part of a digest*/
  7. #      define N_MODERATED 2    /*   group is moderated        */
  8.  
  9.     off_t    ng_fpos;    /* position of article text    */
  10.     off_t    ng_lpos;    /* last text offset
  11.                 /* header lines:        */
  12.     char    *ng_from;    /*   from            */
  13.     char    *ng_name;    /*   senders name        */
  14.     char    *ng_subj;    /*   subject            */
  15.     char    *ng_groups;    /*   newsgroups            */
  16.     char    *ng_path;    /*   path            */
  17.     char    *ng_reply;    /*   reply-to            */
  18.     char    *ng_ident;    /*   message id            */
  19.     char    *ng_follow;    /*   followup to        */
  20.     char    *ng_ref;    /*   references            */
  21.     char    *ng_keyw;    /*   keywords            */
  22.     char    *ng_dist;    /*   distibution        */
  23.     char    *ng_org;    /*   organization        */
  24.     char    *ng_appr;    /*   approved            */
  25.     char    *ng_summ;    /*   summary            */
  26.     
  27.     char    *ng_date;    /*   date            */
  28.  
  29.     char    *ng_rdate;    /*   date-received (News 3)    */
  30.     char    *ng_bref;    /*   back-references (News 3)    */
  31.     
  32.     char    *ng_xlines;    /*   lines (from header)    */
  33.     int    ng_lines;    /*   lines (decoded)        */
  34. } news;
  35.  
  36.  
  37. /*
  38.  * digest article subheader
  39.  */
  40.  
  41. struct digest_header {
  42.     off_t    dg_hpos;    /* position of article header    */
  43.     off_t    dg_fpos;    /* position of article text    */
  44.     off_t    dg_lpos;    /* last text position        */
  45.                 /* header lines:        */
  46.     char    *dg_date;    /*   date            */
  47.     char    *dg_from;    /*   from            */
  48.     char    *dg_subj;    /*   subject            */
  49.     char    *dg_to;        /*   to                */
  50.     
  51.     int    dg_lines;    /*   lines (pseudo field)    */
  52. } digest;
  53.  
  54.  
  55. #define    NEWS_HEADER_BUFFER    2048
  56.  
  57. typedef char    news_header_buffer[NEWS_HEADER_BUFFER];
  58.  
  59.  
  60. FILE *open_news_article(/* header, modes [, buffer1 [, buffer2]] */);
  61.  
  62. /* modes */
  63.  
  64. #define    FILL_NEWS_HEADER    0x0001    /* parse first header -> buffer1 */
  65. #define    FILL_DIGEST_HEADER    0x0002    /* parse second header -> buffer[12] */
  66.  
  67.  
  68. #define    GET_ALL_FIELDS        0x0010    /* get all fields (otherwise only   */
  69.                     /* name, subj, groups, lines        */
  70.  
  71. #define    GET_DATE_ONLY        0x0020    /* get Date field            */
  72.  
  73. #define    FILL_OFFSETS        0x0080    /* fill ng_[hfl]pos */
  74.  
  75.  
  76. #define    DIGEST_CHECK        0x0100    /* set N_DIGEST if "digest" in subj */
  77.                     /* only valid with FILL_NEWS_HEADER */
  78.  
  79.  
  80. #define    SKIP_HEADER        0x1000    /* position after (sub) header */
  81.  
  82.  
  83.